import request from '@/util/request.js'

/**
 * @description 发布/更新零活
 * @param {Object} data
 */
export function saveWork(data) {
	return request({
		url: '/oddJob/activate',
		method: 'POST',
		data
	})
}
/**
 * @description 获取零工过程状态列表
 */
export function getProcessStatusBasis() {
	return request({
		url: '/oddJob/myReleaseJobStatus',
		method: 'GET'
	})
}

/**
 * @description 获取我发布的零工列表
 * @param {Object} data
 */
export function sendWorkList(data) {
	return request({
		url: '/oddJob/myReleaseJob',
		method: 'GET',
		data
	})
}

/**
 * @description 获取我收藏的零工列表
 * @param {Object} data
 */
export function collectWorkList(data) {
	return request({
		url: '/collectWorkList',
		method: 'GET',
		data
	})
}
/**
 * @description 获取我接的活零工列表
 * @param {Object} data
 */
export function robWorkList(data) {
	return request({
		url: '/oddJob/myJoinJob',
		method: 'GET',
		data
	})
}
/**
 * @description 获取零工列表排序依据
 * @param {Object} data
 */
export function getOrderBasis(data) {
	return request({
		url: '/getOrderBasis',
		method: 'GET',
		data
	})
}
/**
 * @description 获取公开的零工列表 
 * @param {Object} data
 */
export function getWorkPublicList(data) {
	return request({
		url: '/oddJob/getOddJobList',
		method: 'GET',
		data
	})
}
/**
 * @description 根据limit获取首页工种
 * @param {Object} data
 */
export function getIndexMenuWorkType(data) {
	return request({
		url: '/getIndexMenuWorkType',
		method: 'GET',
		data
	})
}
/**
 * @description 获取公开零工详情
 * @param {Object} id
 */
export function publicWorkDetail(data) {
	return request({
		url: '/oddJob/getOddJobDetail',
		method: 'GET',
		data
	})
}
/**
 * @description 抢活
 * @param {Object} data
 */
export function robWork(data) {
	return request({
		url: '/oddJob/grabTheJob',
		method: 'POST',
		data
	})
}
/**
 * @description 收藏/取消收藏 零活
 * @param {Object} data
 */
export function collectWork(data) {
	return request({
		url: '/collectWork',
		method: 'POST',
		data
	})
}
/**
 * @description 获取我发布的零工详情
 * @param {Object} id
 */
export function sendWorkDetail(data) {
	return request({
		url: '/oddJob/getOddJobDetail',
		method: 'GET',
		data
	})
}
/**
 * @description 取消
 * @param {Object} data
 */
export function cancelWork(data) {
	return request({
		url: '/oddJob/activate',
		method: 'POST',
		data
	})
}

/**
 * @description 获取我发的活的抢活人列表
 * @param {Object} data
 */
export function applyList(data) {
	return request({
		url: '/applyList',
		method: 'GET',
		data
	})
}
/**
 * @description 获取零活类型树
 */
export function getWorkType() {
	return request({
		url: '/oddJob/getOddTypeTree',
		method: 'GET',
	})
}